import request from '@/utils/request'

/**
 * 行程列表
 */
export function getList(data) {
	return request({
		url: '/app/stroke/strokeList',
		method: 'get',
		data: data
	})
}

/**
 * 行程列表
 */
export function getInfo(id) {
	return request({
		url: `/app/stroke/${id}`,
		method: 'get'
	})
}

/**
 * 约车申请
 */
export function applyList(page) {
	return request({
		url: '/app/applyCar/applyList',
		method: 'get',
		data: {
			pageNum: page
		}
	})
}

/**
 * 约车详情
 */
export function getInfoApply(id) {
	return request({
		url: `/app/applyCar/getInfoApply/${id}`,
		method: 'get'
	})
}

/**
 * 约车详情
 */
export function applyCarInfo(id) {
	return request({
		url: `/app/applyCar/${id}`,
		method: 'get'
	})
}

/**
 * 取消约车申请
 */
export function cancelApply(id) {
	return request({
		url: `/app/applyCar/cancelApply/${id}`,
		method: 'post',
		data: {
			method: 'delete'
		}
	})
}

/**
 * 申请派车
 */
export function applyCar(data) {
	return request({
		url: '/app/stroke/applyCar',
		method: 'post',
		data: data
	})
}

/**
 * 修改车型、司机
 */
export function editStroke(data) {
	console.log('修改参数' , data);
	return request({
		url: '/app/stroke',
		method: 'put',
		data: data
	})
}

/**
 * 修改用车申请
 */
export function editApplyCar(data) {
	return request({
		url: '/app/applyCar',
		method: 'put',
		data: data
	})
}

/**
 * 申请拼车
 */
export function poolCar(data) {
	return request({
		url: '/app/stroke/poolCar',
		method: 'post',
		data: data
	})
}

/**
 * 申请拼车
 */
export function userList() {
	return request({
		url: '/app/stroke/userList',
		method: 'get'
	})
}

/**
 * 修改行程
 * @param {Object} data
 */
export function upMileage(data) {
  return request({
    url: '/bpmforns/reportforms/upMileage',
    method: 'post',
    data: data
  })
}